<?php $filter=['filename'=>FILTER_UNSAFE_RAW,'template_id'=>FILTER_UNSAFE_RAW,'data_package_file'=>FILTER_UNSAFE_RAW];$errorMsg='';if(!$data=filter_input_array(INPUT_POST,$filter)){$errorMsg='提交的信息有误';}else{$archive=new Zmsun\System\Template\TemplatePackageArchive();$filePath=$archive->create($data['template_id'],$data['filename'],$data['data_package_file']?:null,$errorMsg);}if($errorMsg){$res=['status'=>'error','info'=>$errorMsg,];}else{$res=['status'=>'ok','info'=>$filePath,];}echo json_encode($res);?>